<?php
/**
 * Created by PhpStorm.
 * User: h16pham
 * Date: 4/06/14
 * Time: 12:35 AM
 */

require_once 'class/user.class.php';

$fbID = $_GET['fbid'];
$user = User::getFBUser($fbID);

if ($user != null)
{
    session_start();
    $_SESSION['user'] = serialize($user);
    session_write_close();

    header("Location: index.php");
}
else
{
    header("Location: registerFB.php?fbid=$fbID");
}

?>